package com.jvxb.manage.livable.entity;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Date;

/**
 * @author jvxb
 * @since 2022-02-11
 */
@Data
@TableName("redis_change")
public class RedisChange implements Serializable {

    @ApiModelProperty(value = "自增主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty(value = "创建人id")
    private String createrId;
    @ApiModelProperty(value = "发起人")
    private String creator;
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @ApiModelProperty(value = "工单名称")
    private String title;
    @ApiModelProperty(value = "工单说明")
    private String createDesc;
    @ApiModelProperty(value = "预约执行时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date upTime;
    @ApiModelProperty(value = "工单ID")
    private Long workOrderId;
    @ApiModelProperty(value = "集群id")
    private Long clusterId;
    @ApiModelProperty(value = "环境")
    private String env;
    @ApiModelProperty(value = "执行命令")
    private String command;
    @ApiModelProperty(value = "是否执行结束/0:否/1:是")
    private Integer isEnd;
    @ApiModelProperty(value = "执行耗时（ms）")
    private Long responseTime;
    @ApiModelProperty(value = "是否为回滚工单")
    private Integer isRollback;
    @ApiModelProperty(value = "回滚提交顺序列表")
    private String rollbackIds;

    public static final String ID = "id";

    public static final String CREATER_ID = "creater_id";

    public static final String CREATOR = "creator";

    public static final String CREATE_TIME = "create_time";

    public static final String TITLE = "title";

    public static final String CREATE_DESC = "create_desc";

    public static final String UP_TIME = "up_time";

    public static final String WORK_ORDER_ID = "work_order_id";

    public static final String CLUSTER_ID = "cluster_id";

    public static final String ENV = "env";

    public static final String COMMAND = "command";

    public static final String IS_END = "is_end";
    public static final Integer IS_END_NO = 0;
    public static final Integer IS_END_YES = 1;

    public static final String RESPONSE_TIME = "response_time";

    public static final String IS_ROLLBACK = "is_rollback";
    public static final Integer IS_ROLLBACK_YES = 1;
    public static final Integer IS_ROLLBACK_NO = 0;

    public static final String ROLLBACK_IDS = "rollback_ids";

}
